export const listToMap = (list, transObj) => {
  const arr = new Array();
  if (!list.forEach || !transObj.key || !transObj.value) return new Map();
  list.forEach(element => {
    const item = [element[transObj.key], element[transObj.value]];
    arr.push(item);
  });
  const map = new Map(arr);
  return map;
};
